package homework.day04;

import java.io.*;

/**
 * 改正下面程序的错误
 *
 * 程序实现的功能需求:复制一个文件
 * @author Xiloer
 *
 */
public class Test01 {
	public static void main(String[] args) throws IOException {
		FileInputStream fis = new FileInputStream("test1.txt");
		BufferedInputStream bis = new BufferedInputStream(fis);

		FileOutputStream fos = new FileOutputStream("test_cp.txt");
		BufferedOutputStream bos = new BufferedOutputStream(fos);

		int d;
		long l = System.currentTimeMillis();
		while((d = fis.read())!=-1) {
			fos.write(d);
		}
		long b = System.currentTimeMillis();
		System.out.println("复制完毕!用时："+(b-l)+"毫秒.");
	fis.close();
	fos.close();
	}
}




